package com.demo.common.threadpool.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.annotation.Order;

/**
 * @Author：DayDayUp
 * @Create：2023/3/29 10:34
 */
@Order(1)
@Data
@ConfigurationProperties(prefix = ThreadPoolProperties.PREFIX)
public class ThreadPoolProperties {
    public static final String PREFIX = "thread-pool";
    /**
     * 是否开启自动配置
     */
    private boolean enabled = true;

    /**
     * 核心线程数
     */
    private Integer corePoolSize = 5;

    /**
     * 最大线程数
     */
    private Integer maxPoolSize = 20;

    /**
     * 最大线程数
     */
    private Integer queueCapacity = Integer.MAX_VALUE;
    /**
     * 配置队列大小
     */
    private Integer keepAliveSeconds = 60;
    /**
     * 线程名前缀
     */
    private String threadNamePrefix = "ThreadExecutor";

}
